package com.huluobo.high3videoproject.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.huluobo.base.view.BaseActivity;
import com.huluobo.high3videoproject.R;
import com.huluobo.high3videoproject.bean.GoodsInfoBeanResult;
import com.huluobo.high3videoproject.utils.GlideUtils;

import java.util.List;

public class GoodsInfoAdapter extends BaseQuickAdapter<GoodsInfoBeanResult.GoodsInfo, BaseViewHolder> {
    public GoodsInfoAdapter(@Nullable List<GoodsInfoBeanResult.GoodsInfo> data) {
        super(R.layout.item_goods_info, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, GoodsInfoBeanResult.GoodsInfo goodsInfo) {
        ImageView img = baseViewHolder.getView(R.id.goodsInfo_iv_goodsImage);
        GlideUtils.loadNormal(getContext(), img, goodsInfo.getGoods_default_icon());

        baseViewHolder.setText(R.id.goodsInfo_goodsName, goodsInfo.getGoods_desc());
        baseViewHolder.setText(R.id.goodsInfo_price, "￥" + goodsInfo.getGoods_default_price() + "元");
    }
}
